package View;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;

public class PanelTerimaSuratDokumen extends JFrame {

    private JFrame frame = this;
    private JLabel label1, label2, label3, label4, label5, label6;
    private JButton button1, button2;
    private JTextField nomor, perihal, asal, penerima, tanggal;

    public PanelTerimaSuratDokumen() {
        this.setTitle("Form Pengisian Surat/Dokument");
        this.setBounds(100, 100, 370, 400);
        this.setLayout(null);


        label1 = new JLabel("Form Pengisian Surat/Dokument");
        label1.setBounds(0, 10, 370, 30);
        label1.setHorizontalAlignment(JTextField.CENTER);
        this.add(label1);


        JPanel panel = new JPanel();
        panel.setBounds(100, 40, 200, 30);
        ButtonGroup bg = new ButtonGroup();
        final JRadioButton surat = new JRadioButton("Surat");
        final JRadioButton dokument = new JRadioButton("Dokument");

        bg.add(surat);
        bg.add(dokument);

        surat.setEnabled(true);
        dokument.setEnabled(true);

        panel.add(surat);
        panel.add(dokument);

        this.add(panel);
        this.setVisible(true);


        label2 = new JLabel("Nomor");
        label2.setBounds(10, 90, 190, 30);
        this.add(label2);

        label3 = new JLabel("Perihal");
        label3.setBounds(10, 120, 190, 30);
        this.add(label3);

        label4 = new JLabel("Asal");
        label4.setBounds(10, 150, 190, 30);
        this.add(label4);

        label5 = new JLabel("Penerima");
        label5.setBounds(10, 180, 190, 30);
        this.add(label5);

        label6 = new JLabel("Tanggal Terima");
        label6.setBounds(10, 210, 190, 30);
        this.add(label6);

        nomor = new JTextField(50);
        nomor.setBounds(120, 90, 200, 22);
        this.add(nomor);

        perihal = new JTextField(50);
        perihal.setBounds(120, 120, 200, 22);
        this.add(perihal);

        asal = new JTextField(50);
        asal.setBounds(120, 150, 200, 22);
        this.add(asal);

        penerima = new JTextField(50);
        penerima.setBounds(120, 180, 200, 22);
        this.add(penerima);

        tanggal = new JTextField(50);
        tanggal.setBounds(120, 210, 200, 22);
        this.add(tanggal);

        button1 = new JButton("Simpan");
        button1.setBounds(100, 280, 100, 30);
        this.add(button1);

        button2 = new JButton("Batal");
        button2.setBounds(220, 280, 100, 30);
        this.add(button2);

        JPanel panel2 = new JPanel();
        panel2.setBounds(70, 240, 250, 30);
        ButtonGroup bg2 = new ButtonGroup();
        final JRadioButton loker = new JRadioButton("Loker");
        final JRadioButton ruangan = new JRadioButton("Ruangan");
        final JRadioButton lemari = new JRadioButton("Lemari");

        bg.add(loker);
        bg.add(ruangan);
        bg.add(lemari);

        loker.setEnabled(true);
        ruangan.setEnabled(true);
        lemari.setEnabled(true);

        panel2.add(loker);
        panel2.add(ruangan);
        panel2.add(lemari);

        this.add(panel2);
        this.setVisible(true);

        button2.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                frame.setVisible(false);
            }
        });
    }

    public static void main(String[] args) {
        PanelTerimaSuratDokumen ptsd = new PanelTerimaSuratDokumen();
        ptsd.setVisible(true);
    }
}
